package com.example.demo.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.pojo.User;

@RestController
public class TestContorller {
	
	@RequestMapping("/hello")
	public String index(String name) {
		return "hello "+"tuofafa"+" , this is first message";
	}
	
	@RequestMapping("/user")
	public List<User> getUser(){
		List<User> list = new ArrayList<User>();
		list.add(new User("zhangsan","admin",15));
		list.add(new User("lisi","root",29));
		list.add(new User("wangwu","admins",20));
		list.add(new User("liliu","roots",15));
		return list;
	}
	@GetMapping("/print")
	public String print() {
		return "JD";
	}

}
